package com.ytjj.qmyx.supplychain.common.enums;

/**
 * @ClassName LINK平台接口方法
 * @Description TODO
 * 
 * 
 * @Version 1.0
 **/
public enum LinkPlatformMethodEnum {
    ADD("CROSSBORDER_ORDER_CONSIGN","订单上传"),
    CANCEL("GLOBAL_SALE_ORDER_CANCEL", "订单取消"),
    EXPRESS_INFO("CROSSBORDER_LOGISTICS_DETAIL_QUERY", "订单物流详情查询"),
    UPDATE_ORDER("CROSSBORDER_ORDER_INFO_MODIFY", "订单修改"),
    GLOBAL_SALE_ORDER_REFUND_NOTIFY("GLOBAL_SALE_ORDER_REFUND_NOTIFY", "跨境销售订单销退单下单"),
    ;

    private String code;
    private String message;

    LinkPlatformMethodEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        for (LinkPlatformMethodEnum value : LinkPlatformMethodEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }

    public static String getCodeByMessage(String message){
        for (LinkPlatformMethodEnum value : LinkPlatformMethodEnum.values()) {
            if(value.getMessage().equals(message)){
                return value.getCode();
            }
        }
        return null;
    }
}
